<template>
	<view class="content">
		<view class="city">
			<view class="item" v-for="(city,index) in citys" :key="index" @click="subcity(city.name, city.id)">
				<view class="text">{{city.name}}</view>
				<image class="arrow" src="../../static/images/ic_arrow_right.png">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				uid: '',
				// citys: ['安徽', '北京', '重庆'],
				citys: [
					{name:'安徽', id:'01'}, {name:'北京', id:'02'}, {name:'重庆', id:'03'},{name:'福建', id:'04'}, {name:'甘肃', id:'05'},
					{name:'广东', id:'06'}, {name:'广西', id:'07'}, {name:'贵州', id:'08'},{name:'海南', id:'09'}, {name:'河北', id:'10'},
					{name:'河南', id:'11'}, {name:'黑龙江', id:'12'}, {name:'湖北', id:'13'},{name:'湖南', id:'14'}, {name:'吉林', id:'15'},
					{name:'江苏', id:'16'}, {name:'江西', id:'17'}, {name:'辽宁', id:'18'},{name:'内蒙古', id:'19'}, {name:'宁夏', id:'20'},
					{name:'青海', id:'21'}, {name:'陕西', id:'22'}, {name:'山东', id:'23'},{name:'山西', id:'24'}, {name:'上海', id:'25'},
					{name:'四川', id:'26'}, {name:'天津', id:'27'}, {name:'西藏', id:'28'},{name:'新疆', id:'29'}, {name:'云南', id:'30'},
					{name:'浙江', id:'31'}
					
				]
			}
		},
		onLoad(option) {
			this.uid = option.uid;
		},
		methods: {
			// 选择子城市
			subcity(name, id) {
				uni.navigateTo({
				    url: './subcity?uid=' + this.uid + '&id=' + id + '&name=' + name
				});
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		padding: 10px 10px;
	}
	.item {
		padding: 5px 0;
		border-bottom: solid 1px #F2F2F2;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.text {
		font-size: 15px;
		padding: 10px 0;
	}
	.arrow {
		width: 7px;
		height: 12px;
	}
</style>
